package com.kinggm.service.strategy.abs;


import com.kinggm.service.strategy.service.Fly;
import com.kinggm.service.strategy.service.Quark;

public abstract class Duck {
    // 静态属性
    private String name;

    // 动态行为
    private Fly fly;
    private Quark quark;



    public void swim(){
        System.out.println("游泳方法！");
    }






    public void quack(){
        quark.quark();
    }

    public void fly(){
        fly.fly();
    }


    public Fly getFly() {
        return fly;
    }

    public void setFly(Fly fly) {
        this.fly = fly;
    }

    public Quark getQuark() {
        return quark;
    }

    public void setQuark(Quark quark) {
        this.quark = quark;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
